<?php
	# references.php
	# References page of the portfolio 
	# 2013-May

    // Set current page id as a session variable
    $_SESSION['currId'] = 'References';
?>

<!-- References -->
<span id="subject"><?php print $txt_references; ?></span>
<br />
<?php
	$query_refs = "SELECT * FROM reference rf ORDER BY rf.id ASC";
	$result_refs = mysql_query($query_refs);
	
	# Number of referencies
	$num_refs = mysql_num_rows($result_refs);
	
	# Number of rows
	//$num_rows = ceil($num_refs / 2);

    # Get the current language
    if (!isset($_COOKIE['lang'])){
        $currLang = 'fr';
    }
    else
        $currLang = $_COOKIE['lang'];
?>

<table class="tabPanel">
	<?php
		for ($i = 0; $i < $num_refs; ++$i)
		{
			print '<tr>';
				//for ($j = 0; $j < 2; ++$j)
				//{
					if (false !== ($row_ref = mysql_fetch_array($result_refs)))
					{
						print '<td width="50%">';
							print '<div class="panel style-8">';
								print '<div>';
									print '<h5>' . utf8_encode($row_ref['company_name']) . '</h5>';
									print '<p>';
										print '<b>' . utf8_encode($row_ref['full_name']) . '</b><br />';
										print '<b>' . utf8_encode($row_ref['job_title_' . $currLang]). '</b><br />';
										print utf8_encode($row_ref['job_relation_' . $currLang]). '<br /><br />';
										print utf8_encode($row_ref['company_address']). '<br />';
										print utf8_encode($row_ref['email_address']). '<br />';
                                        print utf8_encode($row_ref['email_address2']);
									print '</p>';
								print '</div>';
							print '</div>';
						print '</td>';
					}
				//}
			print '</tr>';
		}
	?>
</table>
